Update to OrdinaryDiffEq.jl v7 and related SciML packages#2910
Update to OrdinaryDiffEq.jl v7 and related SciML packages#2910github-actions[bot] wants to merge 72 commits into
Conversation
5d38e62 to
4a12427
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2910 +/- ##
==========================================
- Coverage 97.09% 97.04% -0.05%
==========================================
Files 630 631 +1
Lines 48855 48898 +43
==========================================
+ Hits 47435 47450 +15
- Misses 1420 1448 +28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JoshuaLampert
left a comment
There was a problem hiding this comment.
Needs dependencies like SummationByPartsOperators.jl to be updated first.
|
We need jlchan/StartUpDG.jl#219 to be merged and released before. |
Co-authored-by: Copilot <copilot@github.com>
Thanks for debugging this! I agree that we can modify the value in this case. |
| # Trixi automatically initializes MPI, this causes issues if precompilation occurs under MPI. | ||
| # The below MPI test uses different compilation flags and thus we want to ensure that precompilation is done with the same flags. | ||
| run(`$(Base.julia_cmd()) --threads=1 --check-bounds=yes -e "using Trixi, OrdinaryDiffEqCore"`) | ||
|
|
There was a problem hiding this comment.
I removed it again and CI seems to be happy with it.
… of PIDController again
With SciML/OrdinaryDiffEq.jl#3570 being merged and released, the correct default values are picked up again and I reverted the changes related to that (and bumped the compat bound for OrdinaryDiffEqCore.jl accordingly). So I think, we only need to wait for #3003 to be merged until this PR is ready. Let me know if you need help with that PR @vchuravy. I would like to finish this, such that we can start integrating the new versions into downstream packages like TrixiShallowWater.jl and TrixiAtmo.jl. |
|
Failing CI is due to changes in OrdinaryDiffEqSDIRK.jl. With OrdinaryDiffEqSDIRK.jl v2.1.0 I can reproduce the reference values and with v2.2.0 I get similar results as CI, which don't pass the tolerance. It's very likely this comes from SciML/OrdinaryDiffEq.jl#3196. Two concrete examples are:
julia> analysis_callback(sol)
(l2 = [8.389498175038025e-6], linf = [2.8474220044816256e-5])and with OrdinaryDiffEqSDIRK.jl v2.1.0 julia> analysis_callback(sol)
(l2 = [8.40483031802723e-6], linf = [2.8990878868540015e-5])The difference is bigger than the tolerances of the ode integrator (absolute and relative tolerances of 1e-10): julia> 8.389498175038025e-6 - 8.40483031802723e-6
-1.533214298920447e-8
julia> 2.8474220044816256e-5 - 2.8990878868540015e-5
-5.16658823723759e-7
trixi_include(joinpath(examples_dir(), "p4est_2d_dgsem",
"elixir_navierstokes_viscous_shock_newton_krylov.jl"),
tspan=(0.0, 0.1),
atol_lin_solve=1e-11,
rtol_lin_solve=1e-11,
atol_ode_solve=1e-10,
rtol_ode_solve=1e-10);(using julia> analysis_callback(sol)
(l2 = [0.005262765896012976, 0.00544494709949278, 2.3365757290728324e-17, 0.0055117947406083685], linf = [0.010910620789879921, 0.011624105849751709, 3.1032813029796676e-16, 0.011845859748702448])and with OrdinaryDiffEqSDIRK.jl v2.1.0 julia> analysis_callback(sol)
(l2 = [3.428501006913763e-5, 2.5967418005918904e-5, 2.7662844381999672e-17, 2.855861765164612e-5], linf = [0.00018762342908829055, 0.00014059002077504434, 3.7252310624872113e-16, 0.00014510700486725092])which have the following differences: julia> analysis_callback(sol).l2 .- l2
4-element StaticArraysCore.SizedVector{4, Float64, Vector{Float64}} with indices SOneTo(4):
0.005228480885943838
0.005418979681486861
-4.297087091271349e-18
0.005483236122956722
julia> analysis_callback(sol).linf .- linf
4-element StaticArraysCore.SizedVector{4, Float64, Vector{Float64}} with indices SOneTo(4):
0.01072299736079163
0.011483515828976665
-6.219497595075436e-17
0.011700752743835197It's also worth noting that OrdinaryDiffEqSDIRK.jl v2.2.0 takes much smaller time steps (~7.9728e-05) than v2.1.0 (~1.0726e-03). |
|
@singhharsh1708 can you look into this? Is the difference only apparent with Krylov linear solvers? If so, that would narrow down what is possibly the issue by a lot. |
|
No, the first example uses |
|
@JoshuaLampert Tried to reproduce on a minimal heat-equation MWE with KenCarp4 + AutoFiniteDiff + LUFactorization (with and without a mass matrix) at abstol=reltol=1e-10. Pre-#3196 master, current master, and the open @generated PR (#3642) all give matching step counts and l2 errors (differences only at FP precision). Could you share a smaller (non-Trixi) repro, or re-check against v2.3.0 / #3642? |
|
Thanks, @singhharsh1708! I will retry with v2.3.0 and SciML/OrdinaryDiffEq.jl#3643. Creating a non-Trixi.jl MWE could be hard and could take some time. |
|
With v2.3.0 the situation already improved and we only have one more failing example (the second I posted above). I also tested it locally with SciML/OrdinaryDiffEq.jl#3643 and got the same as with v2.3.0. Could you maybe look for some issue specific to |
|
@JoshuaLampert Still working on it — I’ll keep you posted. |
|
I locally verified that the remaining failing parabolic tests are fixed by SciML/OrdinaryDiffEq.jl#3653. |
JoshuaLampert
left a comment
There was a problem hiding this comment.
This now contains (almost) only the changes due to the controller interface. So could you take a look please, @termi-official? The parabolic tests will hopefully be fixed once SciML/OrdinaryDiffEq.jl#3653 is merged and released.
|
I think moving forward parts of the IO logic (for restarts) should be moved into a sciml package, as
|
This pull request changes the compat entry for the
RecursiveArrayToolspackage from3.37to3.37, 4.This keeps the compat entries for earlier versions.
Note: I have not tested your package with this new compat entry.
It is your responsibility to make sure that your package tests pass before you merge this pull request.
Closes #2918, closes #2919, closes #2949, closes #2950, closes #2960, closes #2961, closes #2962, closes #2963, closes #2965, closes #2966, closes #2967, closes #2968, closes #2969, closes #2970, closes #2971, closes #2972, closes #2973, closes #2981, closes #2983, closes #2984.
Also closes #2938 and closes #2941.
The required changes, which keep backwards compatibility with older versions from the SciML ecosystem are:
u_modified!byderivative_discontinuity!. Done in Replaceu_modified!byderivative_discontinuity!#2996.stage_limiter!a kwarg #2995.threadis now passed asFastBroadcast.Serial()/FastBroadcast.Threaded()instead ofTrue()/False(). Done in Implement Trixi.Threaded() #3003.sol.destatstosol.stats(sol.destatsis already deprecated from some time and we changed almost all occurrences already in follow SciMLBase update destats -> stats #1372). Done in Replace deprecateddestatsbystats#2994.TheEdit: This was fixed in OrdinaryDiffEqCore.jl v4.2 and is thus not necessary anymore.PIDControllerconstructor, which only acceptsbeta1,beta2,beta3, has (accidentally) another default value for (the algorithm dependent)qsteady_max. We can go back to the previous behavior by also passing the ode algorithm to the constructor of thePIDController. See below for a discussion about this.VectorOfArrayofSVectorsnow returns the underlying floating values, not theSVector, fixed by replacingubyparent(u)Note that I used Claude to help me with refactoring some parts, but I reviewed the code and adapted it.